const sessionStorage = {
    set:(key,value) => {
        let val = '';
        if(value){
            if(value instanceof String){
                val = value;
            }else{
                val = JSON.stringify(value);
            }
        }else{
            val = value;
        }
        window.localStorage.setItem(key,val);
    },
    get:(key) => {
        let value = window.localStorage.getItem(key)
        if(value){
            try{
                value = JSON.parse(value)
            }catch(e){
                console.log(e.message);
            }
            
        }
        return value
    }
}
export default sessionStorage